package com.mx.nbainformation.biz;

import java.util.regex.Matcher;

import com.mx.nbainformation.config.Constants;
import com.mx.nbainformation.util.FileUtil;
import com.mx.nbainformation.util.HttpUtil;

import android.content.Context;

public class BizNewsContent {
	private Context _context;
	public BizNewsContent(Context context)
	{
		_context=context;
	}
	
	public String getDiv(String Url)
	{
		String WebAllText = HttpUtil.doGet(Url, _context);
		if(WebAllText==null)return null;
		Matcher m = FileUtil.getPattern(Constants.Target, WebAllText);
		if(!m.find())return null;
		String target=m.group().replaceAll(Constants.TargetReplace1, "");
		target=target.replaceAll(Constants.TargetReplace2, "");
		target=target.replaceAll(Constants.TargetReplace3_toStyle, Constants.Target_Style);
		target=target.replaceAll(Constants.TargetReplace4, "");
		target=target.replaceAll(Constants.TargetReplace5_toLi, "<li style=\"list-style:none\">");
		return target;
	}
}
